CSV into Tensorflow for Sentiment Analysis

by: munduruca, 8 years ago


I have to perform sentiment analysis on a dataset which is a csv file like: "I like this recipe", 1 where the first item is the phrase and the second is the "sentiment" which varies from -2 to 2 (-2 -1 0 1 2). How can I work with this kind of file using TensorFlow? Thanks in advance



You must be logged in to post. Please login or register an account.



Convert -2 to 2 to a one_hot array and that's your output layer.

[x, x, x, x, x]...so a -1 sentiment would be [0,1,0,0,0]. A 2 sentiment would be [0,0,0,0,1]


-Harrison 8 years ago

You must be logged in to post. Please login or register an account.